<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="d" uri="http://dgg.net/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>


<link rel="stylesheet" type="text/css" href="${basePath}/static/css/production.css?v1"/>
<%--<body>--%>
<input type="hidden" value="${isinforpage}" id="isinforpage">
<input type="hidden" name="id" id="id" value="${productOrder.id}">
<div class="body-main">
    <div id="changeNode">
        <c:if test="${productOrder.status=='ZZSC_STATE_SCPROORDER_CODE6'}">
        <div class="poerate-box">
            <div class="form-label">
                <label>上个完成节点：</label>
            </div>
            <div class="layui-inline">
                <p class="layer-text">${productOrder.latestEndNodeName} <fmt:formatDate value="${productOrder.latestEndNodeTime}"
                                                                                pattern="yyyy-MM-dd"/></p>
            </div>
        </div>
        </c:if>
        <div class="poerate-box">
            <div class="form-label">
                <label>完成节点：</label>
                <input type="hidden" value="${productOrder.id}" id="scorderid"/>
            </div>
            <div class="layui-inline">
                <c:if test="${nodeMap.id != null || nodeMap.id !=''}">
                    <input type="hidden" value="${nodeMap.id}" id="completeNodeId"/>
                    <input type="hidden" value="${nodeMap.name}" id="completeNodeName"/>
                    <div class="layui-inline">
                        <p class="layer-text">${nodeMap.name}</p>
                </c:if>
                </div>
                <div class="layui-inline">
                    <c:if test="${nodeMap.name == '公示'}">
                      <input name="isPass" type="radio" value="1" />公示通过<input name="isPass" type="radio" value="0" />公示不通过
                    </c:if>
                    <c:if test="${nodeMap.name == '通告'}">
                        <label><input name="isPass" type="radio" value="1" />通告通过</label>
                        <label><input name="isPass" type="radio" value="0" />通告不通过</label>
                    </c:if>
                </div>
            </div>
        </div>
        <div class="poerate-box">
            <div class="form-label">
                <label>项目类型：</label>
            </div>
            <div class="layui-inline">
                <select name="flowType" class="select-style"  id="flowType">
                    <c:forEach var="flowT" items="${flowType}">
                        <option value="${flowT.code}" <c:if test="${flowT.code == preFlowType}">selected</c:if>>
                                ${flowT.name}
                        </option>
                    </c:forEach>
                </select>
            </div>
        </div>
        <c:if test="${nodeMap.name != '完结' and nodeMap.name != '强制完结'}">
        <div class="poerate-box">
            <div class="form-label">
                <label>下个节点：</label>
            </div>
            <div class="layui-inline">
                <select name="nextNode" class="select-style" id="NextNode" onchange="isShowSigninId()">
                    <c:forEach var="nodeli" items="${nodelist}">
                        <option value="${nodeli.id}" <c:if test="${nodeli.name eq nextNode.name}">selected</c:if>>${nodeli.name}</option>
                    </c:forEach>
                </select>
            </div>
        </div>
        </c:if>
        <c:if test="${nodeMap.name != '完结' and nodeMap.name != '强制完结'}">
            <div id="signinId">
                <div class="poerate-box">
                    <div class="form-label">
                        <label>下一节点更新人：</label>
                    </div>
                    <div class="layui-input-inline select2-inline">
                        <select name="flowerId" class="chooseUser" id="flowerId">
                            <option value="${user.id}">${user.realName}</option>
                        </select>
                    </div>
                </div>
            </div>
        </c:if>
        <%--不同的节点展示不同的字段 根据数据库配置而来--%>
        <div class="nodeUpdate-box">
            <c:if test="${null != productOrder.flowContent}">
            <form id="nodeUpdateformZz" action="">
                <input type="hidden" value="${productOrder.businessTypeCode}" maxlength="80" id="businessTypeId"
                       name="businessTypeId"/>
                <div class="poerate-box" data-id="1">
                    <div class="form-label">
                        <label>资料交接数：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="dataTransferNum" id="dataTransfernum" value=""
                               class="input-style"/>
                    </div>
                </div>

                <div class="poerate-box" data-id="2">
                    <div class="form-label">
                        <label>网上审批时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="netApprovalTime" placeholder="网上审批时间" class="Wdate input-style"
                               id="netApprovaltime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="3">
                    <div class="form-label">
                        <label>评审时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="reviewTime" placeholder="评审时间" class="Wdate input-style"
                               id="reviewTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="4">
                    <div class="form-label">
                        <label>评审结果：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="reviewResult" maxlength="80" id="reviewResult" value=""
                               class="input-style"/>
                    </div>
                </div>

                <div class="poerate-box" data-id="5">
                    <div class="form-label">
                        <label>公示时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="publicityTime" placeholder="公示时间" class="Wdate input-style"
                               id="publicityTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="6">
                    <div class="form-label">
                        <label>报名时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="signupTime" placeholder="报名时间" class="Wdate input-style"
                               id="signupTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="7">
                    <div class="form-label">
                        <label>换证时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="replacementTime" placeholder="换证时间" class="Wdate input-style"
                               id="replacementTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="8">
                    <div class="form-label">
                        <label>打证时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="playingcardsTime" placeholder="打证时间" class="Wdate input-style"
                               id="playingcardsTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="9">
                    <div class="form-label">
                        <label>领证时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="licensingTime" placeholder="领证时间" class="Wdate input-style"
                               id="licensingTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="10">
                    <div class="form-label">
                        <label>渠道返点：</label>
                    </div>
                    <div class="layui-inline">
                        <label class="input-unit">
                            <input type="text" class="input-style" name="channelRebates" id="channelRebates">
                            <span class="unit">元</span>
                        </label>
                    </div>
                </div>

                <div class="poerate-box" data-id="11">
                    <div class="form-label">
                        <label>对外返点：</label>
                    </div>
                    <div class="layui-inline">
                        <label class="input-unit">
                            <input type="text" class="input-style" name="foreignRebates" id="foreignRebates">
                            <span class="unit">元</span>
                        </label>

                    </div>
                </div>

                <div class="poerate-box" data-id="12">
                    <div class="form-label">
                        <label>公示号：</label>
                    </div>
                    <label class="input-unit">
                        <input type="text" class="input-style" maxlength="80" name="publicityNum" id="publicityNum">
                    </label>
                </div>

                <div class="poerate-box" data-id="13">
                    <div class="form-label">
                        <label>公告时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="noticeTime" placeholder="公告时间" class="Wdate input-style"
                               id="noticeTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="14">
                    <div class="form-label">
                        <label>公告号：</label>
                    </div>
                    <label class="input-unit">
                        <input type="text" class="input-style" maxlength="80" name="noticeNum" id="noticeNum">
                    </label>
                </div>

                <div class="poerate-box" data-id="15">
                    <div class="form-label">
                        <label>渠道出证时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="channelHisTime" placeholder="渠道出证时间" class="Wdate input-style"
                               id="channelHisTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="16">
                    <div class="form-label">
                        <label>资质公司：</label>
                    </div>
                    <div class="layui-inline">
                        <label class="input-unit">
                            <input type="text" class="input-style" maxlength="80" id="company" name="company">
                        </label>
                    </div>
                </div>

                <div class="poerate-box" data-id="17">
                    <div class="form-label">
                        <label>招标文件：</label>
                    </div>
                    <div class="layui-inline">
                        <label class="input-unit">
                            <input type="text" name="biddingDocuments" maxlength="80" class="input-style"
                                   id="biddingDocuments">
                        </label>
                    </div>
                </div>

                <div class="poerate-box" data-id="18">
                    <div class="form-label">
                        <label>招标清单：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="biddingList" maxlength="80"
                               id="biddingList" class="input-style">
                    </div>
                </div>

                <div class="poerate-box" data-id="19">
                    <div class="form-label">
                        <label>标书数量：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="bidingNum" maxlength="80"
                               id="bidingNum" class="input-style">
                    </div>
                </div>

                <div class="poerate-box" data-id="20">
                    <div class="form-label">
                        <label>交标书时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="handoveBidingTime" placeholder="交标书时间" class="Wdate input-style"
                               id="handoveBidingTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="21">
                    <div class="form-label">
                        <label>公示文件：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="publicityFile" maxlength="80"
                               id="publicityFile" class="input-style">
                    </div>
                </div>

                <div class="poerate-box" data-id="22">
                    <div class="form-label">
                        <label>审批通告时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="approvalNoticeTime" placeholder="审批通告时间" class="Wdate input-style"
                               id="approvalNoticeTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>
            </form>
            </c:if>
            <c:if test="${null == productOrder.flowContent}">
            <form id="nodeUpdateformZz" action="">
                <input type="hidden" value="${productOrder.businessTypeCode}" maxlength="80" id="businessTypeId" name="businessTypeId"/>
                <div class="poerate-box" data-id="1">
                    <div class="form-label">
                        <label>资料交接数：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="dataTransferNum" id="dataTransfernum" value="" class="input-style"/>
                    </div>
                </div>

                <div class="poerate-box" data-id="2">
                    <div class="form-label">
                        <label>网上审批时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="netApprovalTime" placeholder="网上审批时间" class="Wdate input-style"
                               id="netApprovaltime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="3">
                    <div class="form-label">
                        <label>评审时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="reviewTime" placeholder="评审时间" class="Wdate input-style"
                               id="reviewTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="4">
                    <div class="form-label">
                        <label>评审结果：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="reviewResult" maxlength="80" id="reviewResult" value=""
                               class="input-style"/>
                    </div>
                </div>

                <div class="poerate-box" data-id="5">
                    <div class="form-label">
                        <label>公示时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="publicityTime" placeholder="公示时间" class="Wdate input-style"
                               id="publicityTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="6">
                    <div class="form-label">
                        <label>报名时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="signupTime" placeholder="报名时间" class="Wdate input-style"
                               id="signupTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="7">
                    <div class="form-label">
                        <label>换证时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="replacementTime" placeholder="换证时间" class="Wdate input-style"
                               id="replacementTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="8">
                    <div class="form-label">
                        <label>打证时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="playingcardsTime" placeholder="打证时间" class="Wdate input-style"
                               id="playingcardsTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="9">
                    <div class="form-label">
                        <label>领证时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="licensingTime" placeholder="领证时间" class="Wdate input-style"
                               id="licensingTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="10">
                    <div class="form-label">
                        <label>渠道返点：</label>
                    </div>
                    <div class="layui-inline">
                        <label class="input-unit">
                            <input type="text" class="input-style" name="channelRebates" id="channelRebates">
                            <span class="unit">元</span>
                        </label>
                    </div>
                </div>

                <div class="poerate-box" data-id="11">
                    <div class="form-label">
                        <label>对外返点：</label>
                    </div>
                    <div class="layui-inline">
                        <label class="input-unit">
                            <input type="text" class="input-style" name="foreignRebates" id="foreignRebates">
                            <span class="unit">元</span>
                        </label>

                    </div>
                </div>

                <div class="poerate-box" data-id="12">
                    <div class="form-label">
                        <label>公示号：</label>
                    </div>
                    <label class="input-unit">
                        <input type="text" class="input-style" maxlength="80" name="publicityNum" id="publicityNum">
                    </label>
                </div>

                <div class="poerate-box" data-id="13">
                    <div class="form-label">
                        <label>公告时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="noticeTime" placeholder="公告时间" class="Wdate input-style"
                               id="noticeTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="14">
                    <div class="form-label">
                        <label>公告号：</label>
                    </div>
                    <label class="input-unit">
                        <input type="text" class="input-style" maxlength="80" name="noticeNum" id="noticeNum">
                    </label>
                </div>

                <div class="poerate-box" data-id="15">
                    <div class="form-label">
                        <label>渠道出证时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="channelHisTime" placeholder="渠道出证时间" class="Wdate input-style"
                               id="channelHisTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="16">
                    <div class="form-label">
                        <label>资质公司：</label>
                    </div>
                    <div class="layui-inline">
                        <label class="input-unit">
                            <input type="text" class="input-style" maxlength="80" id="company" name="company">
                        </label>
                    </div>
                </div>

                <div class="poerate-box" data-id="17">
                    <div class="form-label">
                        <label>招标文件：</label>
                    </div>
                    <div class="layui-inline">
                        <label class="input-unit">
                            <input type="text" name="biddingDocuments" maxlength="80" class="input-style"
                                   id="biddingDocuments">
                        </label>
                    </div>
                </div>

                <div class="poerate-box" data-id="18">
                    <div class="form-label">
                        <label>招标清单：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="biddingList" maxlength="80"
                               id="biddingList" class="input-style">
                    </div>
                </div>

                <div class="poerate-box" data-id="19">
                    <div class="form-label">
                        <label>标书数量：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="bidingNum" maxlength="80"
                               id="bidingNum" class="input-style">
                    </div>
                </div>

                <div class="poerate-box" data-id="20">
                    <div class="form-label">
                        <label>交标书时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="handoveBidingTime" placeholder="交标书时间" class="Wdate input-style"
                               id="handoveBidingTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>

                <div class="poerate-box" data-id="21">
                    <div class="form-label">
                        <label>公示文件：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="publicityFile" maxlength="80"
                               id="publicityFile" class="input-style">
                    </div>
                </div>

                <div class="poerate-box" data-id="22">
                    <div class="form-label">
                        <label>审批通告时间：</label>
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="approvalNoticeTime" placeholder="审批通告时间" class="Wdate input-style"
                               id="approvalNoticeTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </div>
                </div>
            </form>
        </c:if>
        </div>
        <c:if test="${filesRecordMap.size() == 0}">
            <div class="poerate-box">
                <div class="form-label">
                    <label>档案编号：</label>
                </div>
                <div class="layui-inline">
                    <p class="layer-text"></p>
                </div>
            </div>
            <div class="poerate-box">
                <div class="form-label">
                    <label>档案状态：</label>
                </div>
                <div class="layui-inline">
                    <p class="layer-text"></p>
                </div>
            </div>
            <div class="poerate-box">
                <div class="form-label">
                    <label>档案位置：</label>
                </div>
                <div class="layui-inline">
                    <p class="layer-text"></p>
                </div>
            </div>
        </c:if>
        <c:forEach var="filesRecord" items="${filesRecordMap}">
            <div class="poerate-box">
                <div class="form-label">
                    <label>档案编号：</label>
                </div>
                <div class="layui-inline">
                    <p class="layer-text"> ${filesRecord.filesNo}</p>
                </div>
            </div>
            <div class="poerate-box">
                <div class="form-label">
                    <label>档案状态：</label>
                </div>
                <div class="layui-inline">
                    <p class="layer-text"> ${filesRecord.filesStatus}</p>
                </div>
            </div>
            <div class="poerate-box">
                <div class="form-label">
                    <label>档案位置：</label>
                </div>
                <div class="layui-inline">
                    <p class="layer-text"> ${filesRecord.filesLocation}</p>
                </div>
            </div>
        </c:forEach>
        <div class="line"></div>
        <div>
            <div class="remark-input-box">
                <p class="mb8 required"><span>备注：</span></p>
                <textarea class="textarea-style" rows="3" id="remark" name="remark" placeholder="500字以内"></textarea>
            </div>
            <ul class="data-warp">
                <li>
                    <a href="javascript:void(0)" class="upload-button" id="upload"></a>
                    <input class="layui-upload-file" type="file" name="file" multiple="" id="annexUpload" data-type="product" data-fileid="${productOrder.id}">
                    <p>上传附件</p>
                </li>
            </ul>
        </div>
    </div>
    <!--更新节点 end-->
</div>
<script src="${rootUrl}/static/js/zzsc/common/files/annex.js?v=${version}" type="text/javascript" charset="utf-8"></script>
<script src="${rootUrl}/static/js/zzsc/production/sc_divisionUser.js?v=${version}" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
        $(document).ready(function () {
            areaLength($('#remark'),500);
            chooseUserPlug.init($('.chooseUser'),{
                width:'189px',
                url:sysInfo.basePath+'/zzsc/common/find_user_choose.do',
                multiple:false,// 单选false或不写该参数，多选true
                allowClear:false,
                otherParam:{
                    /**
                     * type: 用户信息选择类型（必填）
                     *       all:全部用户，division：当前登录人所在事业部，department:当前登录人所在部门及以下，role: 查询指定角色用户，
                     * roleCode : 角色Code，（type为role时，必填）
                     * locked: 用户状态，（选填，默认全部状态）
                     *      0、正常；1、锁定；2、离职
                     */
                    type:'division',
                    locked:0,
                    roleCode:'ZZSC_FLOW_USER'
                }
            });
            var ids = '${ids}';
            var idStr = ids.split(",");
            $("#assistId").val(idStr).trigger("change");
            nodeUpdate();
            isShowSigninId();
        });

    //更新节点
    function nodeUpdate() {
        var changeVal = $('#completeNodeId').val();
        var data = document.getElementById("completeNodeName");
        var scorderid = $('#scorderid').val();
        data === '完结' || data === '强制完结' ? $('#signinId').hide() : $('#signinId').show();
        $.ajax({
            type: 'POST',
            data: {nodeid: changeVal,id:scorderid},
            url: sysInfo.basePath + '/zzsc/inprocess/return_drop_down.do',
            dataType: 'JSON',
            success: function (data) {
                if (data.code === 0) {
                    var nodefieldids = data.data.relationfieldids;
                    var $nodeUpdate = $(".nodeUpdate-box .poerate-box");
                    $nodeUpdate.hide();
                    if (nodefieldids){
                        var strs = nodefieldids.split(","); //字符分割
                        var thisDate = "";
                        $nodeUpdate.find("input").val("");
                        $nodeUpdate.each(function () {
                            thisDate = $(this).attr("data-id");
                            for (i = 0; i < strs.length; i++) {
                                if (thisDate == strs[i] || thisDate == 0 || thisDate == 100) {
                                    $(this).show();
                                }
                            }
                        });
                    }
                } else {
                    DGG.Warning(data.msg);
                }

            }
        });
        DGG.loading('close');
    }

    //保存更新节点的信息
    function updateNodeReceiveZz() {
        var remark = $('#remark').val();
        if (checkIsEmpty(remark.trim())){
            DGG.Warning("请输入备注!");
            return;
        }
        //如果这两个填写了,验证数字是否满足条件
        if ($('#channelRebates').is(':visible') && $('#channelRebates').val().trim()){
            if (!isFloatRangeSam('#channelRebates',2,'99999999.99')){//验证渠道返点
                return false;
            }
        }
        if ($('#foreignRebates').is(':visible') && $('#foreignRebates').val().trim()) {
            if (!isFloatRangeSam('#foreignRebates',2,'99999999.99')){//验证对外返点
                return false;
            }
        }
        var params = $('#nodeUpdateformZz').serializeArray();
        var completeNodeId = $('#completeNodeId').val();
        var completeNodeName = $('#completeNodeName').val();
        var scorderid = $('#scorderid').val();
        var flowType = $('#flowType').val();
        var nextNodeId = $('#NextNode').val();
        var nextNodeName = $('#NextNode').find('option:selected').text();
        var flowUserId = $('#flowerId').val();
        var isPass = $("input[name='isPass']:checked").val();
        if((completeNodeName =="公示" || completeNodeName == "通告") && undefined ==isPass){
            DGG.Warning("请选择通过还是不通过！");
            return;
        }
        if(undefined==isPass){
            isPass = 1;
        }
        params.push({name: 'flowUserId', value: flowUserId});
        params.push({name: 'completeNodeId', value: completeNodeId});
        params.push({name: 'completeNodeName', value: completeNodeName});
        params.push({name: 'scorderid', value: scorderid});
        params.push({name: 'remark', value: remark});
        params.push({name: 'flowType', value: flowType});
        params.push({name: 'nextNodeId', value: nextNodeId});
        params.push({name: 'nextNodeName', value: nextNodeName});
        params.push({name: 'flowUserId', value: flowUserId});
        params.push({name: 'isPass', value: isPass});
        DGG.Confire("确定更新节点吗？", '更新节点', function () {
            DGG.loading();
            $.ajax({
                type: 'POST',
                data: params,
                url: sysInfo.basePath + '/zzsc/inprocess/save_node_update.do',
                dataType: 'JSON',
                success: function (data) {
                    DGG.loading('close');
                    if (data.code != 0) {
                        DGG.Errors(data.msg);
                    } else {
                        DGG.Succeed("操作成功!");
                        // window.location.reload();
                        receiveTableObj.ajax.reload(null,false);
                        layer.closeAll()
                    }
                },
                error: function () {
                }
            });
        });
    }

    //保存更新节点的信息
    function updateNodeZz() {
        var remark = $('#remark').val();
        if (checkIsEmpty(remark.trim())){
            DGG.Warning("请输入备注!");
            return;
        }
        //如果这两个填写了,验证数字是否满足条件
        if ($('#channelRebates').is(':visible') && $('#channelRebates').val().trim()){
            if (!isFloatRangeSam('#channelRebates',2,'99999999.99')){//验证渠道返点
                return false;
            }
        }
        if ($('#foreignRebates').is(':visible') && $('#foreignRebates').val().trim()) {
            if (!isFloatRangeSam('#foreignRebates',2,'99999999.99')){//验证对外返点
                return false;
            }
        }
        var params = $('#nodeUpdateformZz').serializeArray();
        var completeNodeId = $('#completeNodeId').val();
        var completeNodeName = $('#completeNodeName').val();
        var scorderid = $('#scorderid').val();
        var flowType = $('#flowType').val();
        var nextNodeId = $('#NextNode').val();
        var nextNodeName = $('#NextNode').find('option:selected').text();
        var flowUserId = $('#flowerId').val();
        var isPass = $("input[name='isPass']:checked").val();
        if((completeNodeName =="公示" || completeNodeName == "通告") && undefined ==isPass){
            DGG.Warning("请选择通过还是不通过！");
            return;
        }
        if(undefined==isPass){
            isPass = 1;
        }
        params.push({name: 'flowUserId', value: flowUserId});
        params.push({name: 'completeNodeId', value: completeNodeId});
        params.push({name: 'completeNodeName', value: completeNodeName});
        params.push({name: 'scorderid', value: scorderid});
        params.push({name: 'remark', value: remark});
        params.push({name: 'flowType', value: flowType});
        params.push({name: 'nextNodeId', value: nextNodeId});
        params.push({name: 'nextNodeName', value: nextNodeName});
        params.push({name: 'flowUserId', value: flowUserId});
        params.push({name: 'isPass', value: isPass});
        DGG.Confire("确定更新节点吗？", '更新节点', function () {
            DGG.loading();
            $.ajax({
                type: 'POST',
                data: params,
                url: sysInfo.basePath + '/zzsc/inprocess/save_node_update.do',
                dataType: 'JSON',
                success: function (data) {
                    DGG.loading('close');
                    if (data.code != 0) {
                        DGG.Errors(data.msg);
                    } else {
                        DGG.Succeed("操作成功!");
                        // window.location.reload();
                        table.ajax.reload(null,false);
                        layer.closeAll()
                    }
                },
                error: function () {
                }
            });
        });
    }
    //保存更新节点的信息
    function updateNodeDetailZz() {
        var remark = $('#remark').val();
        if (checkIsEmpty(remark.trim())){
            DGG.Warning("请输入备注!");
            return;
        }
        //如果这两个填写了,验证数字是否满足条件
        if ($('#channelRebates').is(':visible') && $('#channelRebates').val().trim()){
            if (!isFloatRangeSam('#channelRebates',2,'99999999.99')){//验证渠道返点
                return false;
            }
        }
        if ($('#foreignRebates').is(':visible') && $('#foreignRebates').val().trim()) {
            if (!isFloatRangeSam('#foreignRebates',2,'99999999.99')){//验证对外返点
                return false;
            }
        }
        var params = $('#nodeUpdateformZz').serializeArray();
        var completeNodeId = $('#completeNodeId').val();
        var completeNodeName = $('#completeNodeName').val();
        var scorderid = $('#scorderid').val();
        var flowType = $('#flowType').val();
        var nextNodeId = $('#NextNode').val();
        var nextNodeName = $('#NextNode').find('option:selected').text();
        var flowUserId = $('#flowerId').val();
        var isPass = $("input[name='isPass']:checked").val();
        if((completeNodeName =="公示" || completeNodeName == "通告") && undefined ==isPass){
            DGG.Warning("请选择通过还是不通过！");
            return;
        }
        if(undefined==isPass){
            isPass = 1;
        }
        params.push({name: 'flowUserId', value: flowUserId});
        params.push({name: 'completeNodeId', value: completeNodeId});
        params.push({name: 'completeNodeName', value: completeNodeName});
        params.push({name: 'scorderid', value: scorderid});
        params.push({name: 'remark', value: remark});
        params.push({name: 'flowType', value: flowType});
        params.push({name: 'nextNodeId', value: nextNodeId});
        params.push({name: 'nextNodeName', value: nextNodeName});
        params.push({name: 'flowUserId', value: flowUserId});
        params.push({name: 'isPass', value: isPass});
        DGG.Confire("确定更新节点吗？", '更新节点', function () {
            DGG.loading();
            $.ajax({
                type: 'POST',
                data: params,
                url: sysInfo.basePath + '/zzsc/inprocess/save_node_update.do',
                dataType: 'JSON',
                success: function (data) {
                    DGG.loading('close');
                    if (data.code != 0) {
                        DGG.Errors(data.msg);
                    } else {
                        DGG.Succeed("操作成功!");
                        layer.closeAll()
                        setTimeout(function () {
                            window.location.reload();
                        }, 1000);
                    }
                },
                error: function () {
                }
            });
        });
    }
    function isShowSigninId() {
        var nodeName = $('#NextNode').find('option:selected').text();
        if(nodeName === '完结' || nodeName === '强制完结' ){
            $("#signinId").hide();
        }else {
            $("#signinId").show();
        }
    }
</script>
<%--</body>--%>




